package com.dream.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/**
 * 卷
 * 
 * @author Administrator
 *
 */
@Entity
@Table(name = "sys_testpaper")
public class Sys_TestPaper extends AllId implements Serializable
{

	/**
	 * 
	 * 
	 * 
	 * 
	 */
	private static final long serialVersionUID = 1L;
 
	private SysUser sysUser;//哪个老师的
	private Sys_LearnPlant sys_LearnPlant;//哪个环节的
	private Long tstartTime;
	private Long tendTime;
	private String showStartTime;
	private String showEndTime;
	private String note;
	private String name;
	private String type = "0";//0规定时间，1固定时间 
	
	private String state="0";//1表示已完成
	private List<Sys_Question> listsq = null;//一个卷中有多少个题
	
	private List<Sys_User_TestPaper> listsut =null;//一个卷可以属于多个学生用户
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sys_TestPaper", orphanRemoval = true)
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@BatchSize(size = 20) 
	public List<Sys_User_TestPaper> getListsut()
	{
		return listsut;
	}

	public void setListsut(List<Sys_User_TestPaper> listsut)
	{
		this.listsut = listsut;
	}
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sys_TestPaper", orphanRemoval = true)
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@BatchSize(size = 20) 
	public List<Sys_Question> getListsq()
	{
		return listsq;
	}
	public void setListsq(List<Sys_Question> listsq)
	{
		this.listsq = listsq;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade(CascadeType.PERSIST)
	public SysUser getSysUser()
	{
		return sysUser;
	}
	public void setSysUser(SysUser sysUser)
	{
		this.sysUser = sysUser;
	}
	public Long getTstartTime()
	{
		return tstartTime;
	}
	public void setTstartTime(Long tstartTime)
	{
		this.tstartTime = tstartTime;
	}
	public Long getTendTime()
	{
		return tendTime;
	}
	public void setTendTime(Long tendTime)
	{
		this.tendTime = tendTime;
	}
	public String getShowStartTime()
	{
		return showStartTime;
	}
	public void setShowStartTime(String showStartTime)
	{
		this.showStartTime = showStartTime;
	}
	public String getShowEndTime()
	{
		return showEndTime;
	}
	public void setShowEndTime(String showEndTime)
	{
		this.showEndTime = showEndTime;
	}
	@Column(length=5000)
	public String getNote()
	{
		return note;
	}
	public void setNote(String note)
	{
		this.note = note;
	}
	public String getType()
	{
		return type;
	}
	public void setType(String type)
	{
		this.type = type;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@Cascade(CascadeType.PERSIST)
	public Sys_LearnPlant getSys_LearnPlant()
	{
		return sys_LearnPlant;
	}
	public void setSys_LearnPlant(Sys_LearnPlant sys_LearnPlant)
	{
		this.sys_LearnPlant = sys_LearnPlant;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public Sys_TestPaper(String table_id, Long tstartTime, Long tendTime, String showStartTime, String showEndTime, String note, String name, String type, String state,String userName,String userId,String complateTimeShow,String state1,String icCheck,Long pValue) {
		super(table_id);
		this.tstartTime = tstartTime;
		this.tendTime = tendTime;
		this.showStartTime = showStartTime;
		this.showEndTime = showEndTime;
		this.note = note;
		this.name = name;
		this.type = type;
		this.state = state;
		super.setString1(userName);
		super.setString2(userId);
		super.setString3(complateTimeShow);
		super.setString4(state1);
		super.setDesc(icCheck);
		this.pValue=pValue;
		
	}
	
	private Long pValue;
	
	@Transient
	public Long getpValue() {
		return pValue;
	}

	public void setpValue(Long pValue) {
		this.pValue = pValue;
	}

	public Sys_TestPaper() {
		 
	}
	
	

}
